get random posts wordpress

46

get random posts wordpress -

$randomPosts = get_posts(array(
   'orderby' => 'rand',
   'posts_per_page' => 5,
   'tag' => $tag,
));

Comments

Submit
0 Comments